﻿namespace Methods
{
    using System;

    public class ReversingDigits
    {
        // 1.1.9.07. Write a method that prints the digits of a given decimal number in a reversed order.
        // For example 256, must be printed as 652.

        public static int ReverseNumber(int num)
        {
            char[] nummy = new char[num.ToString().Length];
            nummy = num.ToString().ToCharArray();
            for (int i = 0; i < num.ToString().Length / 2; i++)
            {
                char firstTemp = nummy[i];
                nummy[i] = nummy[num.ToString().Length - 1 - i];
                nummy[num.ToString().Length - 1 - i] = firstTemp;
            }
            num = int.Parse(string.Join("", nummy));
            return num;
        }
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(ReverseNumber(n));
        }
    }
}